package com.malguy.entity;

import com.malguy.controllers.groups.ValidationGroup1;
import com.malguy.controllers.groups.ValidationGroup2;
import lombok.*;
import org.springframework.lang.NonNull;

import javax.validation.constraints.*;

/**
 * @author malguy-wang sir
 * @create ---
 */
@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class student {
    @NotNull(message = "{student.id.notnull}",groups = {ValidationGroup1.class})
    private Integer id;
    @NotNull(message = "{student.name.notnull}",groups = {ValidationGroup1.class, ValidationGroup2.class})
    @Size(min = 2,max = 10,message = "{student.name.length}",groups = {ValidationGroup1.class,ValidationGroup2.class})
    private String name;
    @Max(value = 100,message = "{student.age.error}",groups = { ValidationGroup2.class})
    private int age;
    @Email(message = "{student.email.error}",groups = {ValidationGroup1.class, ValidationGroup2.class})
    private String email;
}
